VOWELS = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]

class Solution(object):
    def reverseVowels(self, s):
        """
        :type s: str
        :rtype: str
        """
        l = 0
        h = len(s) - 1
        sL = [c for c in s]

        while l < h:
            lc = sL[l]
            hc = sL[h]
            if (lc in VOWELS) and (hc in VOWELS):
                (sL[l], sL[h]) = (hc, lc)
                l += 1
                h -= 1
            else:
                if lc not in VOWELS:
                    l += 1
                if hc not in VOWELS:
                    h -= 1
        
        return ''.join(sL)

s = Solution()
print(s.reverseVowels("hello"))
